Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update chain on network change #2497

Merged
merged 6 commits into from
Jul 10, 2024
Merged

update chain on network change #2497

merged 6 commits into from
Jul 10, 2024

Conversation

glitch-txs
Copy link
Contributor

Breaking Changes

N/A

Changes

  • feat:
  • fix: update chain on network change
  • chore:

Associated Issues

closes #...

Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jul 10, 2024 6:05pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jul 10, 2024 6:05pm

@@ -244,11 +244,17 @@ export class Web3Modal extends Web3ModalScaffold {
this.syncNetwork(chainImages)
})

NetworkController.subscribeKey('caipNetwork', () => {
NetworkController.subscribeKey('caipNetwork', (newCaipChain: CaipNetwork | undefined) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for aligning naming, could we make it newCaipNetwork?

Suggested change
NetworkController.subscribeKey('caipNetwork', (newCaipChain: CaipNetwork | undefined) => {
NetworkController.subscribeKey('caipNetwork', (newCaipNetwork: CaipNetwork | undefined) => {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I guess you don't have to set type definitions since subscribeKey should already been set the type of the parameter.

Suggested change
NetworkController.subscribeKey('caipNetwork', (newCaipChain: CaipNetwork | undefined) => {
NetworkController.subscribeKey('caipNetwork', (newCaipChain) => {

Copy link
Contributor

@enesozturk enesozturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments @glitch-txs 🙏🏽

@tomiir tomiir merged commit 04eff2d into main Jul 10, 2024
9 checks passed
@tomiir tomiir deleted the fix/switch-chain branch July 10, 2024 18:14
This was referenced Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants